import {
  postRequest,
  postRequestList,
  postRequestData,
  postRequestJson,
  getRequest,
  getRequestInfo,
} from '../utils/request'
export const getSupplierList = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestList(`/api/sop/sop/supplierInfo/pageList`, data)

export const addSupplier = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/supplierInfo/saveSupplierInfo`, data)

export const editSupplier = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/supplierInfo/updateSupplierInfo`, data)

export const updateSupplierStatusBatch = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/supplierInfo/batchUpdateUseStatusByIds`, data)

export const getDetailInfos = <T>(data?: any): Promise<IResponsePost<T>> =>
  getRequestInfo(`/api/sop/sop/supplierInfo/getInfoById`, data)

export const getUserPremissSupplier = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/supplierInfo/getUserPremissSupplier`, data)

export const exportSupplierListExcel = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/supplierInfo/exportExcel`, data)

export const supplierInfoPush = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/supplierInfo/push`, data)
